Removes event listener from the object.

<div class="definition">
    off(type, [handler])
</div>

<div class="arguments">
    <table>
    <tr>
        <td>type</td>
        <td><b>string</b>, name of the event, could have multiple if separated by space or comma</td>
    </tr>
    <tr>
        <td>handler</td>
        <td><b>function</b>, JavaScript function (<i>optional</i>)</td>
    </tr>
    </table>
</div>

OR

<div class="definition">
    off(eventData, handler)
</div>

<div class="arguments">
    <table>
    <tr>
        <td>eventData</td>
        <td><b>object</b>, parameters of the event</td>
    </tr>
    <tr>
        <td>handler</td>
        <td><b>function</b>, JavaScript function </td>
    </tr>
    </table>
</div>

Returns <i>undefined</i>.

<h4>Description</h4>

You can remove a specific listener for a specific event, all listener for a specific event, or all listener for all events. For example, if you
have a layout (same for grid, toolbar, etc.) defined in the following way:
<textarea class="javascript">
let layout = new w2layout({
    name: 'layout',
    panels: [
        { type: 'top', size: 40 },
        { type: 'main', content: 'This is main panel' },
        { type: 'preview', size: 200 }
    ]
})
</textarea>

You can remove a specific event listener (note that the handler cannot be an anonymous function):

<textarea class="javascript">
layout.off('refresh', handler)
</textarea>

All listeners for the event:

<textarea class="javascript">
layout.off('refresh')
layout.off('refresh resize') // multiple events
</textarea>

All listeners for all events:

<textarea class="javascript">
layout.off('*');
</textarea>

<h4>Event Namespace</h4>
While adding an event listener, you can provide a namespace for the event:
<textarea class="javascript">
layout.on('render.myplugin', event => {
    console.log(event.target, event)
})
layout.on('refresh.myplugin', event => {
    console.log(event.target, event)
})
</textarea>

It provides a convenience to remove events listener in an easy way without specifying all events and functions
they were registered with:
<textarea class="javascript">
layout.off('.myplugin')
</textarea>
